package com.es.message;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;

import com.es.util.page.PageBean;
import com.es.util.page.PageNavigator;
import com.opensymphony.webwork.interceptor.ServletRequestAware;
import com.opensymphony.xwork.ActionSupport;

public class RetrieveMsgListAction  extends ActionSupport implements ServletRequestAware{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	HttpServletRequest request;
	 
	   public String execute()throws Exception
	   {
		   String queryPhone = request.getParameter("queryPhone")==null?"":request.getParameter("queryPhone");
		   String queryEmpCode = request.getParameter("queryEmpCode")==null?"":request.getParameter("queryEmpCode");
		   String queryContent = request.getParameter("queryContent")==null?"":request.getParameter("queryContent");
		   String queryDay = request.getParameter("queryDay")==null?"":request.getParameter("queryDay");
		   String curpage = request.getParameter("curpage")==null?"1":request.getParameter("curpage");
		   
		   MessageBiz manegeBiz = new MessageBiz();
		   PageNavigator pageNav = new PageNavigator();
		   if(!curpage.equals(""))
			   pageNav.setCurpage(Integer.parseInt(curpage));
		   ArrayList<String> param = new ArrayList<String>();
		   param.add(queryEmpCode);
		   param.add(queryPhone);
		   param.add(queryContent);
		   param.add(queryDay);
		 
		   PageBean pageBean  = manegeBiz.queryEsgList(pageNav, param);
		   request.setAttribute("pageBean", pageBean);
		   request.setAttribute("queryEmpCode", queryEmpCode);
		   request.setAttribute("queryPhone", queryPhone);
		   request.setAttribute("queryContent", queryContent);
		   request.setAttribute("queryDay", queryDay);
		   return "success";
	   }
	
	   public void setServletRequest(HttpServletRequest request) {
		     this.request = request;
		   }
}